﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:cal="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"
    xmlns:my="clr-namespace:WorldIndex.Modules.Countries.Views"             
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="WorldIndex.Modules.Countries.Views.CountryListView"             
    Width="400" Height="300" mc:Ignorable="d" Foreground="{x:Null}">
    <UserControl.Resources>
        <my:CountryListViewModel x:Key="theViewModel" />
        <ControlTemplate x:Key="CountryListBoxTemplate" TargetType="ListBox">
        	<Grid Margin="0,0,-86,0">
        		<VisualStateManager.VisualStateGroups>
        			<VisualStateGroup x:Name="ValidationStates">
        				<VisualState x:Name="InvalidFocused"/>
        				<VisualState x:Name="Valid"/>
        				<VisualState x:Name="InvalidUnfocused"/>
        			</VisualStateGroup>
        		</VisualStateManager.VisualStateGroups>
        	</Grid>
        </ControlTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"
         DataContext="{Binding ., Source={StaticResource theViewModel}}">
        <ListBox Width="145"
                 ItemsSource="{Binding Countries, Mode=OneWay}" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalMargin" Template="{StaticResource CountryListBoxTemplate}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Height="69" Width="253">
                    	<Grid.Background>
                    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    			<GradientStop Color="Black" Offset="0"/>
                    			<GradientStop Color="#FF6C0000" Offset="1"/>
                    		</LinearGradientBrush>
                    	</Grid.Background>
                    	<Rectangle x:Name="Background">
                    		<Rectangle.Fill>
                    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    				<GradientStop Color="#FF1A0000" Offset="0"/>
                    				<GradientStop Color="#FF450000" Offset="1"/>
                    			</LinearGradientBrush>
                    		</Rectangle.Fill>
                    	</Rectangle>
                    	<TextBlock Margin="8,8,0,52" TextWrapping="Wrap" HorizontalAlignment="Left" Foreground="White" FontSize="14.667" Text="{Binding Name, Mode=OneWay}"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <TextBlock HorizontalAlignment="Right" Margin="0,56,52,113" Width="136" Text="Test" TextWrapping="Wrap" Foreground="#FFEAE3E3"/>
        <Rectangle Fill="#FFCD4848" Stroke="Black" Height="46" Margin="169,0,64,28" VerticalAlignment="Bottom"/>
    </Grid>
</UserControl>
